#!/bin/bash
BACKUPDIR=/boot/configs

for i in `cat /opt/hifiberry/etc/config-files`; do
  if [ -f $i ]; then 
    DIR=`dirname $i`
    cd $DIR
    if [ ! -d $BACKUPDIR/$DIR ]; then
      mkdir -p $BACKUPDIR/$DIR
    fi
    echo "Storing $i"
    cp $i $BACKUPDIR/$DIR
  fi
done

